﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Warhammer40K_Simulator.model
{
    public class optiongroup
    {

        public optiongroup clone()
        {
            optiongroup og = new optiongroup();
            og.label = label;
            og.count = count;

            foreach (option o in children)
            {
                og.children.Add(o.clone());
            }

            return og;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        private String label;
        public String Label
        {
            get
            {
                return label;
            }
            set
            {
                label = value;
                NotifyPropertyChanged("Label");
            }
        }

        private int count;
        public int Count
        {
            get
            {
                return count;
            }
            set
            {
                count = value;
                NotifyPropertyChanged("Count");
            }
        }

        private ObservableCollection<option> children = new ObservableCollection<option>();
        public ObservableCollection<option> Children
        {
            get
            {
                return children;
            }
            set
            {
                children = value;
                NotifyPropertyChanged("Children");
            }
        }
    }
}
